import App from "./App";
import $request from "@/config/request.js";
import $api from "@/config/api.js";
import store from "@/store/index.js";
import {
	initalToken,
	resetToken,
	errMessageToast,
	removeStorage,
	saveStorage,
	getToken,
	varitfyToken,
	updateToken
} from "@/utils/index.js";
// #ifndef VUE3
import Vue from "vue";
Vue.config.productionTip = false;
App.mpType = "app";
Vue.prototype.$eventBus = new Vue();
Vue.prototype.$store = store;
Vue.prototype.$request = $request;
Vue.prototype.$api = $api;
Vue.prototype.$initalToken = initalToken.bind(Vue.prototype);
Vue.prototype.$updateToken = updateToken.bind(Vue.prototype);
Vue.prototype.$resetToken = resetToken.bind(Vue.prototype);
Vue.prototype.$errMessageToast = errMessageToast.bind(Vue.prototype);
Vue.prototype.$removeStorage = removeStorage.bind(Vue.prototype);
Vue.prototype.$saveStorage = saveStorage.bind(Vue.prototype);
Vue.prototype.$getToken = getToken.bind(Vue.prototype);
Vue.prototype.$varitfyToken = varitfyToken.bind(Vue.prototype);
const app = new Vue({
	...App,
});
app.$mount();
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from "vue";
export function createApp() {
	const app = createSSRApp(App);
	return {
		app,
	};
}
// #endif
